<?php
class Soctype extends AppModel {

	var $name = 'Soctype';
	var $useDbConfig = 'socdual';
	var $hasOne = array('UsersSoctype');

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $hasMany = array(
			'Soctypesrel' => array('className' => 'Soctypesrel',
								'foreignKey' => 'soctype_id',
								'dependent' => false,
								'conditions' => '',
								'fields' => '',
								'order' => '',
								'limit' => '',
								'offset' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''
			),
	);


	function getTypes($conditions = array()) {
		foreach ($conditions as $k => $v) {
			if (empty($v)) {
				unset($conditions[$k]);
			}
		}
		return $this->find('all', array('conditions'=>$conditions, 'recursive'=>-1));
	}

	function getType($conditions = array()) {
		return $this->find('first', array('conditions'=>$conditions, 'recursive'=>-1));
	}

}
?>
